package net.zoneland.knowledge.controller.bean;

/**
 * 任务列表类型.
 *
 * @author: zmq
 * 2021/9/29
 */
public enum WorkListTypeEnum {
    /**
     * 草稿.
     */
    DRAFT("draft", "草稿"),

    /**
     * 部门管理员审批.
     */
    TODO_TASK("todoTask", "待办"),

    /**
     * 分任务子流程.
     */
    DONE_TASK("doneTask", "已办"),
    /**
     * 责任人审批.
     */
    MY_APPLICANT("myApplicant", "我的申请"),
    /**
     * 待阅.
     */
    TO_READ("toRead", "待阅"),
    /**
     * 已阅.
     */
    HAS_READ("hasRead", "已阅");

    /**
     * 构造.
     * @param value 值
     * @param name 名称
     */
    WorkListTypeEnum(final String value, final String name) {
        this.value = value;
        this.name = name;
    }
    /**
     * key.
     */
    private String value;

    /**
     * label.
     */
    private String name;

    /**
     * .
     *
     * @return value
     */
    public String getValue() {
        return value;
    }

    /**
     * .
     *
     * @return name
     */
    public String getName() {
        return name;
    }

    public static WorkListTypeEnum getByValue(String value) {
        for (WorkListTypeEnum categoryEnum : WorkListTypeEnum.values()) {
            if (categoryEnum.value.equals(value)) {
                return categoryEnum;
            }
        }
        return null;
    }

}
